package practice1_100;

import java.util.HashMap;
import java.util.Map;

public class Practice76 {
    public String minWindow(String s, String t) {
        Map<Character ,Integer> count=new HashMap<>();
        Map<Character ,Integer> actual=new HashMap<>();

        for (int i=0;i<t.length();i++){
            if(!count.containsKey(t.charAt(i)))
                count.put(t.charAt(i),1);
            else
                count.put(t.charAt(i),count.get(t.charAt(i)+1));
        }
        int left=0,right=0;
        int index1=0,index2=0;

        while (right<s.length()){
            if(count.containsKey(s.charAt(right))){
                if (!actual.containsKey(s.charAt(right))){
                    actual.put(s.charAt(right),1);
                }else {
                    actual.put(s.charAt(right),actual.get(s.charAt(right))+1);
                }
            }
            right++;
            if(count.equals(actual)) {
                index1=left;
                index2=right;
                
            }
        }
        return null;
    }

}
